package com.project.staticProxy;

public class MissDen implements IEat{
    private IEat target;
    //聚合目标对象
    public MissDen(IEat target){
        this.target = target;
    }
    @Override
    public void eat() {
        System.out.println("订餐");
        //调用目标方法
        target.eat();
        System.out.println("开发票");
    }

    @Override
    public void drink() {
        System.out.println("订餐");
        target.drink();
        System.out.println("开发票");
    }
}
